// 发帖相关
// noinspection JSUnusedLocalSymbols

import {NukeApi} from "@ginstone/nga-api/dist/src/method/NukeApi";
import {MyCache} from "@ginstone/common-utils/dist/src/utils/MyCache";
import {PostApi} from "@ginstone/nga-api/dist/src/method/PostApi";

export default {
    namespaced: true,
    state: {
        cache: new MyCache(),
    },
    mutations: {
        method(state, payload) {

        },
    },
    actions: {
        method: ({dispatch, commit, state, rootGetters}, payload) => {
            const client = rootGetters["Account/getClient"]();

        },
        //准备回复
        prepare: ({dispatch, commit, state, rootGetters}, params) => {
            const client = rootGetters["Account/getClient"]();
            return PostApi.prepare(client, params)
        },
        // 查询版面的主题分类
        topicKeyList: ({dispatch, commit, state, rootGetters}, {fid, force}) => {
            const client = rootGetters["Account/getClient"]();
            const method = () => NukeApi.topicKeyList(client, fid)
            return state.cache.use({fid, type: 'topicKey'}, method, force)
        },

    },
    getters: {},
}